<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            // 1.判断对象是否为空的方法
            // for-in
            function isEmptyObject(obj) {
                for (let o in obj) {
                    return false;
                }
                return true;
            }

            // 2.Object.keys()判断长度是否为0
            //JSON.stringify()
            function isEmptyObject(obj) {
                return JSON.stringify(obj) === '{}';
            }
        </script>
    </body>
</html>
